<?php
namespace app\setting\controller;
use app\api\controller\v2\Auth;
use \app\auth\controller\Base;
use app\check\controller\Check;
use \think\Db;
/**
 * @title 星盘参数设置
 * @url http://localapi.goddessxzns.com/setting/astro
 * @version 2.0.0
 * @desc 所有星盘中的参数配置  如：行星显示配置等 1。当get请求中无tid参数返回，表示用户保存星盘设置为新增操作，需使用POST请求。当返回参数中存在tid参数时，表示用户保存星盘配置为更新操作，使用PUT请求，当用户使用配置还原功能时，表示删除当前用户配置，使用Delete请求
 * Class Astro
 * @package app\setting\controller
 */
class Astro extends Check
{
    protected $restActionList = ['index','save','update','delete'];

    public $charts = [
        'now'=>'wechat_backup_07_18_14_43_00.app_astro_setting_now',// 天象盘
        'natal'=>'app_astro_setting_natal',// 本命盘
        'transits'=>'app_astro_setting_transits',// 行运盘
        'thirdprogressed'=>'app_astro_setting_thirdprogressed',// 三限盘
        'thirdprogressedvsnatal'=>'app_astro_setting_thirdprogressedvsnatal',// 三限VS本命
        'progressions'=>'app_astro_setting_progressions',// 次限盘
        'progressionsvsnatal'=>'app_astro_setting_progressionsvsnatal',// 次限VS本命
        'solar'=>'app_astro_setting_solar',// 太阳弧
        'firdaria'=>'app_astro_setting_firdaria',// 法达盘
        'profection'=>'app_astro_setting_profection',// 小限盘
        'synastry'=>'app_astro_setting_synastry',// 比较盘
        'composite'=>'app_astro_setting_composite',// 组合中点盘
        'composite_thirdprogressed'=>'app_astro_setting_composite_thirdprogressed',// 组合三限盘
        'composite_progressions'=>'app_astro_setting_composite_progressions',// 组合次限盘
        'davison'=>'app_astro_setting_davison',// 时空中点盘
        'solar_return'=>'app_astro_setting_solar_return',// 太阳返照盘
        'lunar_return' =>'app_astro_setting_lunar_return',// 月亮返照盘
        'marks'=>'app_astro_setting_marks',// 马克思盘
        'divination'=>'wechat_backup_07_18_14_43_00.app_astro_setting_divination',// 提问盘
    ];
    public $setting1 = [
        'now'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'thirdprogressed'=>[
//            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'progressions'=>[
//            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111100100001111',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
//            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
//            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
//            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
//            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
//            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
        ],
        'davison'=>[
//            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
//            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
    ];// tid 1
    public $setting2 = [
        'now'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressed'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressions'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111100100001111',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100100001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'davison'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111100000001001',
            'planet_orb_all'=>[3,2.5,1,1,1,1.5,1.5,1,1,0.5],
            'h_sys'=>'p',
        ],
    ];// tid 2
    public $setting3 = [
        'now'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'natal'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'transits'=>[
            'asp_orb_all'=> [0=>2,60=>1,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressed'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'thirdprogressedvsnatal'=>[
            'asp_orb_all'=> [0=>3,60=>2,90=>3,120=>3,180=>3,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressions'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'progressionsvsnatal'=>[
            'asp_orb_all'=> [0=>2,60=>2,90=>2,120=>2,180=>2,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar'=>[
            'asp_orb_all'=> [0=>1,60=>0,90=>1,120=>0,180=>1,30=>0,150=>1,45=>1,135=>1,72=>0,144=>0],
            'asps_display'=>[0,45,90,135,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'solar_return'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'lunar_return'=>[
            'asp_orb_all'=> [0=>4,60=>2,90=>3,120=>3,180=>3.5,30=>0.5,150=>1,45=>1,135=>1,72=>0.5,144=>0.5],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'firdaria'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
            'style'=>'cn',
            'firdaria'=>'default',
        ],
        'profection'=>[
            'asp_orb_all'=> [0=>8,60=>6,90=>7,120=>7,180=>7,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'synastry'=>[
            'asp_orb_all'=> [0=>6,60=>4,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_thirdprogressed'=>[
            'asp_orb_all'=> [0=>5,60=>4,90=>5,120=>5,180=>5,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'composite_progressions'=>[
            'asp_orb_all'=> [0=>4,60=>3,90=>4,120=>4,180=>4,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'davison'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'marks'=>[
            'asp_orb_all'=> [0=>6,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
        'divination'=>[
            'asp_orb_all'=> [0=>7,60=>5,90=>6,120=>6,180=>6,30=>1,150=>2,45=>2,135=>2,72=>2,144=>2],
            'asps_display'=>[0,60,90,120,180,30,150],
            'planets_display'=>'111111111111111001001',
            'planet_orb_all'=>[0,0,0,0,0,0,0,0,0,0],
            'h_sys'=>'p',
        ],
    ];// tid 3

    /**
     * @title 获取星盘配置
     * @desc 此处要注意 tid参数是否返回
     * @readme /doc/md/setting/astro/index.md
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function index()
    {
        $uid = $this->user['id'];

        if(!$uid)
        {
            return show(10222, '用户不存在', [], 200 );
        }
        $tid = input('tid/d');
        $chart = htmlspecialchars(input('chart/s'));
        if(!trim($chart)) $chart = 'now';// 默认取天象盘配置
        if(!$tid) $tid = 1;// 默认取现代方案

        $table = isset($this->charts[$chart]) ? $this->charts[$chart] : null;

        if(!$table)
        {
            return show(10701, '星盘不存在', [], 400 );
        }

//        $or_data = Db::table('app_setting_')->where(['uid'=>$uid,'tid'=>$tid])->find();

        $data = Db::table($table)->field('tid,asp_orb_all,asps_display,planets_display,planet_orb_all,h_sys')->where(['tid'=>$tid,'uid'=>$uid,'status'=>0])->find();

        if(!$data)
        {
            switch ($tid)
            {
                case 1:
                    $data = isset($this->setting1[$chart]) ? $this->setting1[$chart] : null;
                    break;
                case 2:
                    $data = isset($this->setting1[$chart]) ? $this->setting1[$chart] : null;
                    break;
                case 3:
                    $data = isset($this->setting1[$chart]) ? $this->setting1[$chart] : null;
                    break;
            }
        }
        else
        {
            $data['asp_orb_all'] = json_decode($data['asp_orb_all']);
            $data['asps_display'] = json_decode($data['asps_display']);
            $data['planet_orb_all'] = json_decode($data['planet_orb_all']);
        }

        return show(200, '成功', $data);
    }

    /**
     * @title 保存星盘配置
     * @desc chart_value 格式：<br/> {"asp_orb_all":{"0":8,"60":6,"90":7,"120":7,"180":7,"30":1,"150":2,"45":2,"135":2,"72":2,"144":2},"asps_display":[0,60,90,120,180],"h_sys":"p","planet_orb_all":[0,0,0,0,0,0,0,0,0,0],"planets_display":"111111111100100001001"}
     * @return \think\Response|\think\response\Json|\think\response\Jsonp|\think\response\Redirect|\think\response\Xml
     */
    public function save()
    {
        $uid = $this->user['id'];

        $tid = input('tid/d');
        $chart = input('chart/s');
        if(!$tid || !$chart) return show(10722, '参数错误', [], 400 );


        $set = input('chart_value/s');

        $setArr = json_decode($set,true);
        if(!isset($setArr['asp_orb_all'])
            || !isset($setArr['asps_display'])
            || !isset($setArr['planets_display'])
            || !isset($setArr['planet_orb_all'])
            || !isset($setArr['h_sys'])
            || count($setArr['asp_orb_all']) != 11
            || strlen($setArr['planets_display']) != 21
            || count($setArr['planet_orb_all']) != 10
            || strlen($setArr['h_sys']) != 1
            || substr($setArr['planets_display'],0,10) != '1111111111'
        )
        {
            return show(10722, '参数错误', [], 400 );
        }
        $data = [
            'tid'=>$tid,
            'uid'=>$uid,
            'asp_orb_all'=>json_encode($setArr['asp_orb_all']),
            'asps_display'=>json_encode($setArr['asps_display']),
            'planets_display'=>$setArr['planets_display'],
            'planet_orb_all'=>json_encode($setArr['planet_orb_all']),
            'h_sys'=>$setArr['h_sys'],
            'create_time'=>time(),
        ];

        $table = isset($this->charts[$chart]) ? $this->charts[$chart] : null;

        if(!$table)
        {
            return show(10701, '星盘不存在', [], 400 );
        }
        if(Db::table($table)->where(['uid'=>$uid,'tid'=>$tid])->find())
        {
            return show(200, '保存成功');
        }
        if(Db::table($table)->insertGetId($data))
        {
            return show(200, '保存成功');
        }
        return show(10222, '保存失败', [], 500 );
    }

    /**
     * @title 更新星盘配置
     * @desc chart_value 格式：<br/> {"asp_orb_all":{"0":8,"60":6,"90":7,"120":7,"180":7,"30":1,"150":2,"45":2,"135":2,"72":2,"144":2},"asps_display":[0,60,90,120,180],"h_sys":"p","planet_orb_all":[0,0,0,0,0,0,0,0,0,0],"planets_display":"111111111100100001001"}
     */
    public function update()
    {
        $uid = $this->user['id'];

        $tid = input('tid/d');
        $chart = htmlspecialchars(input('chart'));
        if(!$tid || !$chart) return show(10722, '参数错误', [], 400 );


        $set = input('chart_value/s');

        $setArr = json_decode($set,true);
        if(!isset($setArr['asp_orb_all'])
            || !isset($setArr['asps_display'])
            || !isset($setArr['planets_display'])
            || !isset($setArr['planet_orb_all'])
            || !isset($setArr['h_sys'])
            || count($setArr['asp_orb_all']) != 11
            || strlen($setArr['planets_display']) != 21
            || count($setArr['planet_orb_all']) != 10
            || strlen($setArr['h_sys']) != 1
            || substr($setArr['planets_display'],0,10) != '1111111111'
        )
        {
            return show(10722, '参数错误', [], 400 );
        }
        $data = [
            'asp_orb_all'=>json_encode($setArr['asp_orb_all']),
            'asps_display'=>json_encode($setArr['asps_display']),
            'planets_display'=>$setArr['planets_display'],
            'planet_orb_all'=>json_encode($setArr['planet_orb_all']),
            'h_sys'=>$setArr['h_sys'],
            'update_time'=>time(),
        ];

        $table = isset($this->charts[$chart]) ? $this->charts[$chart] : null;

        if(!$table)
        {
            return show(10701, '星盘不存在', [], 400 );
        }
        if(Db::table($table)->where(['tid'=>$tid,'uid'=>$uid,'status'=>0])->update($data))
        {
            return show(200, '更新成功');
        }
        return show(10222, '更新失败', [], 500 );
    }

    /**
     * @title 还原配置（删除用户当前配置）
     * @return \think\Response|\think\response\Json|\think\response\Jsonp|\think\response\Redirect|\think\response\Xml
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function delete()
    {
        $uid = $this->user['id'];

        $tid = input('tid/d');
        $chart = htmlspecialchars(input('chart/s'));
        if(!$tid || !$chart) return show(10222, '参数错误', [], 400 );

        $table = isset($this->charts[$chart]) ? $this->charts[$chart] : null;

        if(!$table)
        {
            return show(10701, '星盘不存在', [], 400 );
        }

        Db::table($table)->where(['uid'=>$uid,'tid'=>$tid])->delete();

        return show(200, '删除成功');
    }

    /**
     * 参数规则
     * @name 字段名称
     * @type 类型
     * @require 是否必须
     * @default 默认值
     * @desc 说明
     * @range 范围
     * @return array
     */
    public static function getRules()
    {
        $rules = [
            'index' => [
                'access_token' => ['name' => 'access_token', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '接口访问凭证', 'range' => '32位',],
                'ucid' => ['name' => 'ucid', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '用户ucid', 'range' => '32位',],
                'tid' => ['name' => 'tid', 'type' => 'int', 'require' => 'true', 'default' => '无', 'desc' => '设置方案id', 'range' => '',],
                'chart' => ['name' => 'chart', 'type' => 'string', 'require' => 'true', 'default' => 'now', 'desc' => '星盘类型，如now 表示为天象盘', 'range' => '',],
            ],
            'save'=>[
                'access_token' => ['name' => 'access_token', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '接口访问凭证', 'range' => '32位',],
                'ucid' => ['name' => 'ucid', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '用户ucid', 'range' => '32位',],
                'tid' => ['name' => 'tid', 'type' => 'int', 'require' => 'true', 'default' => '无', 'desc' => '设置方案id', 'range' => '',],
                'chart' => ['name' => 'chart', 'type' => 'string', 'require' => 'true', 'default' => 'now', 'desc' => '星盘类型，如now 表示为天象盘', 'range' => '',],
                'chart_value' => ['name' => 'chart_value', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '星盘配置json字符串', 'range' => '',],
            ],
            'update'=>[
                'access_token' => ['name' => 'access_token', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '接口访问凭证', 'range' => '32位',],
                'ucid' => ['name' => 'ucid', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '用户ucid', 'range' => '32位',],
                'tid'=>['name' => 'tid', 'type' => 'int', 'require' => 'true', 'default' => '无', 'desc' => '设置方案id', 'range' => '不限',],
                'id'=>['name' => 'id', 'type' => 'int', 'require' => 'true', 'default' => '无', 'desc' => '注释id', 'range' => '不限',],
                'chart' => ['name' => 'chart', 'type' => 'string', 'require' => 'true', 'default' => 'now', 'desc' => '星盘类型，如now 表示为天象盘', 'range' => '',],
                'chart_value' => ['name' => 'chart_value', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '星盘配置json字符串', 'range' => '',],
            ],
            'delete'=>[
                'access_token' => ['name' => 'access_token', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '接口访问凭证', 'range' => '32位',],
                'ucid' => ['name' => 'ucid', 'type' => 'string', 'require' => 'true', 'default' => '无', 'desc' => '用户ucid', 'range' => '32位',],
                'tid'=>['name' => 'tid', 'type' => 'int', 'require' => 'true', 'default' => '无', 'desc' => '设置方案id', 'range' => '不限',],
                'chart' => ['name' => 'chart', 'type' => 'string', 'require' => 'true', 'default' => 'now', 'desc' => '星盘类型，如now 表示为天象盘', 'range' => '',],
            ],
        ];
        return $rules;
    }
}